using NUnit.Framework;
using SharpTestsEx;

namespace AltNetHispano.Vale.Tests 
{
    public class EmailValidatorTest 
    {
        private const string PropertyName = "emailProperty";

        [TestCase(null)]
        [TestCase("")]
        [TestCase("valid@email.com")]
        [TestCase("val+id@email.com")]
        [TestCase("val-id@email.com")]
        [TestCase("val=id@email.com")]
        [TestCase("val_id@email.com")]
        [TestCase("val!id@email.com")]
        [TestCase("valid.valid@email.com")]
        public void ValidEmailShouldReturnEmptyMessage(string email) 
        {
            CommonValidators.IsEmail(null, PropertyName, email).Should().Be.Empty();
        }

        [TestCase("invalid@@email.com")]
        [TestCase("inv@lid@email.com")]
        [TestCase("inva lid@email.com")]
        [TestCase("invalid @ email.com")]
        [TestCase("invalid@ email.com")]
        [TestCase(@"invalid\@email.com")]
        [TestCase("invalid(@email.com")]
        [TestCase("invalid.email.com")]
        [TestCase("valid..valid@email.com")]
        public void InvalidEmailShouldReturnANonEmptyMessage(string email) 
        {
            CommonValidators.IsEmail(null, PropertyName, email).Should().Not.Be.Empty();    
        }
    }
}